import request from '/@/utils/request';

export function menusApi() {
  return {
    dataList : (params : object) =>{
      return request({
				url: '/admin/menus/data',
				method: 'post',
				data: params,
			})
    },
    delete : (id : number) =>{
      return request({
        url:'/admin/menus/delete',
        method:'post',
        data:{id:id}
      })
    },
    save:(params:object) => {
      return request({
        url:'/admin/menus/save',
        method:'post',
        data:params
      })
    },
    detail:(id:number) => {
      return request({
        url:'/admin/menus/detail',
        method:'post',
        data:{id:id}
      })
    },

    disenabled:(params) => {
      return request({
        url:'/admin/menus/disenabled',
        method:'post',
        data:params
      })
    },

    cascader_menus_data:(params?) => {
      return request({
        url:'/admin/menus/cascader_menu_data',
        method:'post',
        data:params
      })
    },

    delete_action:(id:number) => {
      return request({
        url:'/admin/menus/delete_action',
        method:'post',
        data:{id:id}
      })
    },

    load_power_action:()=>{
      return request({
        url:'/admin/menus/get_authorize',
        method:'post',
        data:{}
      })
    }

  }
}